#
#	El manager v.0.01 - Derivart (http://www.derivart.info)
#	@Coded: Mar Cane / Martin Nadal (2009)
#
import pickle

class settings():

    def __init__(self):
        self.path = ""
        self.fileName ="settings.pkl"
        self.pickledlist = {'folder':''}
        self.readSettings()

    def saveSettings(self):
        file = open(self.fileName, 'w')
        pickle.dump(self.pickledlist,file)
        file.close()

    def readSettings(self):        
        unpicklefile = open(self.fileName, 'r')
        self.pickledlist = pickle.load(unpicklefile)
        unpicklefile.close()
# folder *******************************************************************
    def setFolder(self, value):
        self.pickledlist['folder'] = value
        self.saveSettings()

    def getFolder(self):
        return self.pickledlist['folder']
# actions ******************************************************************
    def setAction1(self, value):
        self.pickledlist['action1'] = value
        self.saveSettings()
    def setAction2(self, value):
        self.pickledlist['action2'] = value
        self.saveSettings()
    def setAction3(self, value):
        self.pickledlist['action3'] = value
        self.saveSettings()

    def getAction1(self):
        return self.pickledlist['action1']
    def getAction2(self):
        return self.pickledlist['action2']
    def getAction3(self):
        return self.pickledlist['action3']

# actions ******************************************************************
    def setOption1(self, value):
        self.pickledlist['option1'] = value
        self.saveSettings()
    def setOption2(self, value):
        self.pickledlist['option2'] = value
        self.saveSettings()
    def setOption3(self, value):
        self.pickledlist['option3'] = value
        self.saveSettings()

    def getOption1(self):
        return self.pickledlist['option1']
    def getOption2(self):
        return self.pickledlist['option2']
    def getOption3(self):
        return self.pickledlist['option3']
